<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <script src="../../js/commonJs.js"></script>
    <script src="../../js/commonCss.js"></script>
    <title>轮播图管理</title>
</head>
<body>
<div id="app" v-cloak>
    <header>
        <span class="title">轮播图管理</span>
    </header>
    <div class="pd10">
        <el-table :data="tableData" stripe border style="width: 100%">
            <el-table-column prop="title" label="名称"></el-table-column>
            <el-table-column prop="number" label="数量"></el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button @click="showWheel(scope.row)" type="text" size="medium">查看</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: function () {
            return {
				tableData:[]
			}
        },
        methods: {
			showWheel: function (row) {
				window.location.href = '2-wheel-detail.html?type='+row.typeId
			},
			//获取轮播图数量
			getWheelList() {
				var url = baseURL + "irWheel/list?token="+token
				axios.post(url)
						.then((res) => {
							if (res.data.code === 0) {
								if(res.data.data!=null){
									vm.tableData = res.data.data;
								}
							} else {
								vm.$message({
									message: res.data.msg,
									type: 'error'
								});
							}
						})
			},
        },
        created() {
			this.getWheelList()
        },
    });
</script>
</html>
